package leetcode;

import java.util.HashSet;

/**
 * @Project : ProgrammingExercises
 * @Package : Leetcode
 * @File : Q2568.java
 * @Author : WangRuoyu
 * @Date 2023/2/23 9:36
 */
public class Q2568 {
    public int minImpossibleOR(int[] nums) {
        HashSet<Integer> set = new HashSet<>();

        for (int i = 0; i < nums.length; ++i) {
            set.add(nums[i]);
        }

        int x = 1;

        while (set.contains(x)) {
            x *= 2;
        }

        return x;
    }

    public static void main(String[] args) {
        Q2568 sl = new Q2568();
        int[] nums = {5, 3, 2};
        System.out.println(sl.minImpossibleOR(nums));
    }
}